package cn.stronglink.asset.module.hardware.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.baomidou.mybatisplus.plugins.Page;

import cn.stronglink.asset.model.Hardware;
import cn.stronglink.asset.module.hardware.service.HardwareService;
import cn.stronglink.suite.core.base.AbstractController;
import cn.stronglink.suite.core.exception.BusinessException;
/**
 * @author sunlei:
 * @version 创建时间：2017年12月11日 上午11:24:59 类说明 : 硬件设备 控制器
 */
@Controller
@RequestMapping(value = "hardware")
public class HardwareController extends AbstractController {

	@Autowired
	private HardwareService hardwareService;

	// 查询所有硬件的最后心跳时间
	@RequestMapping(value = "queryList")
	public ResponseEntity<ModelMap> queryList(ModelMap modelMap, HttpServletRequest request,
			HttpServletResponse response, @RequestBody Map<String, Object> params) {	
		@SuppressWarnings("unchecked")
		Page<HashMap<String,Object>> page = (Page<HashMap<String,Object>>) super.getPage(params);
		Page<HashMap<String,Object>> data = hardwareService.queryHardList(page,params);
		return setSuccessModelMap(modelMap, data);
	}
		 
}
